import java.util.ArrayList;


public class Journey {

	private Car car;
	private Destination destination;
	private int passenger;
	private int year;
	private static final double BASEUNIT = 0.5;
	
	public Journey(Car car, Destination destination, int passenger, int year){
		this.car = car;
		this.destination = destination;
		this.passenger = passenger;
		this.year = year;
	}

	public Journey(Destination destination, int year){
		this.destination = destination;
		this.year = year;
	}
	
	public Car getCar() {
		return car;
	}

	public void setCar(Car car) {
		this.car = car;
	}

	public Destination getDestination() {
		return destination;
	}

	public void setDestination(Destination destination) {
		this.destination= destination;
	}

	public int getPassenger() {
		return passenger;
	}

	public void setPassenger(int passenger) {
		this.passenger = passenger;
	}

	public int getYear() {
		return year;
	}

	public void setYear(int year) {
		this.year = year;
	}	
	
	public double getBill() {
		double cost = 0.0;
		cost = destination.getDistance() * BASEUNIT;
		if(passenger > 2) {
			cost += 5;
		}
		return cost;
	}
}
